import javax.imageio.IIOException;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class Demo3 {
    public static void main(String[] args) throws IIOException {
        try(OutputStream outputStream = new FileOutputStream("./test2.txt")) {
            //已经打开了文件

            outputStream.write(97);//a --> 97是ascll码值
            outputStream.write(98);//b
            outputStream.write(99);//c
            outputStream.write(100);//d
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
